package com.klhappy.houyuan.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.klhappy.houyuan.R;

import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by MrPu on 15/11/25.
 */
public class GoodClassAdapter extends BaseAdapter {

    private List<String> list;
    private Context context;

    public GoodClassAdapter(List<String> list, Context context) {
        this.list = list;
        this.context = context;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View view, ViewGroup parent) {
        ViewHodler hodler;
        if (view == null){
            view = LayoutInflater.from(context).inflate(R.layout.item_good_class ,null);
            hodler = new ViewHodler(view);
            view.setTag(hodler);
        }else {
            hodler = (ViewHodler) view.getTag();
        }



        return view;
    }


    class ViewHodler{
        @InjectView(R.id.good_img) ImageView good_img;
        @InjectView(R.id.good_name) TextView good_name;
        @InjectView(R.id.good_money) TextView good_money;
        @InjectView(R.id.good_sore) TextView good_sore;
        public ViewHodler(View view) {
            ButterKnife.inject(this, view);
        }

    }
//    tv.getPaint().setFlags(Paint. STRIKE_THRU_TEXT_FLAG );
}
